package cn.itsource.pet.controller;
import cn.itsource.basic.util.AjaxResult;
import cn.itsource.basic.util.PageList;
import cn.itsource.pet.pojo.domain.SearchMasterMessage;
import cn.itsource.pet.pojo.dto.AuditDto;
import cn.itsource.pet.query.SearchMasterMessageQuery;
import cn.itsource.pet.service.SearchMasterMessageService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 宠物发布控制
 */
@RestController
@RequestMapping("/searchMasterMessage")
public class SearchMasterMessageController {
    @Autowired
    private SearchMasterMessageService service;

    /**
     * 发布的接口
     * @param message
     * @return
     */
    @RequestMapping("/publish")
    public AjaxResult publish(@RequestBody SearchMasterMessage message){
        return service.publish(message);
    }
    //    查询全部分页查询
    @PostMapping("pagelist")
    @ApiOperation(value = "分页查询所有的部门")
    public PageList<SearchMasterMessage> findPageList(@RequestBody SearchMasterMessageQuery query){
       return service.findPageList(query);
    }
/**
 * 审核接口
 */
@PostMapping("/audit")
public AjaxResult audit(@RequestBody AuditDto auditDto){
    AjaxResult audit = service.audit(auditDto);
    return audit;
}
}
